package com.umfb.bootstrap.commons;

/**
 * Created by zcah on 18-5-21.
 */
public class Column {
    /**
     * columns 绑定的数据源， 由 columns. dataOption 定义。
     */
    private String data;

    /**
     * columns 的名字， 由 columns. nameOption 定义。
     */
    private String name;

    /**
     * 标记列是否能被搜索,为true代表可以，否则不可以， 这个是由 columns. searchableOption控制
     */
    private boolean searchable;

    /**
     * 标记列是否能排序, 为 true代表可以，否则不可以， 这个是由 columns. orderableOption控制
     */
    private boolean orderable;

    /**
     * 标记具体列的搜索条件
     */
    private Search search;

    public Column() {
        this.search = new Search();
    }

    public Column(String data, String name, Boolean searchable, Boolean orderable, Search search) {
        super();
        this.data = data;
        this.name = name;
        this.searchable = searchable;
        this.orderable = orderable;
        this.search = search;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSearchable() {
        return searchable;
    }

    public void setSearchable(boolean searchable) {
        this.searchable = searchable;
    }

    public boolean isOrderable() {
        return orderable;
    }

    public void setOrderable(boolean orderable) {
        this.orderable = orderable;
    }

    public Search getSearch() {
        return search;
    }

    public void setSearch(Search search) {
        this.search = search;
    }

    public void setSearchValue(String searchValue) {
        this.search.setValue(searchValue);
    }
}
